package com.qk.mapper;

import com.qk.entity.Role;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface RoleMapper {
    @Delete("delete from role where id=#{id}")
    void deleteById(Integer id);

    List<Role> selectList(String name, String label);

    @Insert("insert into role(name,label,create_time,update_time) values(#{name},#{label},#{createTime},#{updateTime})")
    void addRole(Role role);

    @Select("select * from role where id=#{id}")
    Role selectById(Integer id);

    void update(Role role);
    @Select("select ID, NAME, LABEL, REMARK, CREATE_TIME, UPDATE_TIME from role")
    List<Role> listAll();
}
